<template>
  <div>
    <h1>修改销售员</h1>
    <p>销售员姓名 <input type="text" v-model="salesmans.name" /></p>
    <p>销售员账号 <input type="text" v-model="salesmans.account" /></p>
    <p>销售员密码 <input type="text" v-model="salesmans.password" /></p>
    <button @click="updateSalesmans(salesmans)">确认修改</button>
  </div>
</template>

<script>
import { createNamespacedHelpers } from "vuex";
const { mapState, mapActions } = createNamespacedHelpers("salesmans");
export default {
  data() {
    return {
      salesmans: {
        name: "",
        account: "",
        password: "",
      },
    };
  },
  methods: {
    ...mapActions(["getSalesmansById", "updateSalesmans"]),
  },
  computed: {
    ...mapState(["salesmansDate"]),
  },
};
</script>

<style>
</style>